﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_ZW_YINHANGHPHZ实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_ZW_YINHANGHPHZ
    {
        private decimal? m_dec_i_benhangdzbs;

        private decimal? m_dec_i_benhangtpbs;

        private decimal? m_dec_i_benhangzbs;

        private decimal? m_dec_i_daozhangbs;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_kuahangdzbs;

        private decimal? m_dec_i_kuahangtpbs;

        private decimal? m_dec_i_kuahangzbs;

        private decimal? m_dec_i_qitabs;

        private decimal? m_dec_i_tuipiaobs;

        private decimal? m_dec_i_type;

        private decimal? m_dec_i_zongbis;

        private decimal? m_dec_i_zwym;

        private decimal m_dec_id;

        private decimal? m_dec_n_benhangtpje;

        private decimal? m_dec_n_benhangzje;

        private decimal? m_dec_n_daozhangje;

        private decimal? m_dec_n_henhangdzje;

        private decimal? m_dec_n_kuahangdzje;

        private decimal? m_dec_n_kuahangtpje;

        private decimal? m_dec_n_kuahangzje;

        private decimal? m_dec_n_qitaje;

        private decimal? m_dec_n_tuipiaoje;

        private decimal? m_dec_n_zongjine;

        private DateTime? m_DT_d_daorurq;

        private DateTime? m_DT_d_riqi;

        private string m_str_s_wenjianm;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     账务年月
        /// </summary>
        public decimal? I_ZWYM
        {
            get { return m_dec_i_zwym; }
            set { m_dec_i_zwym = value; }
        }

        /// <summary>
        ///     文件名
        /// </summary>
        public string S_WENJIANM
        {
            get { return m_str_s_wenjianm; }
            set { m_str_s_wenjianm = value; }
        }

        /// <summary>
        ///     日期
        /// </summary>
        public DateTime? D_RIQI
        {
            get { return m_DT_d_riqi; }
            set { m_DT_d_riqi = value; }
        }

        /// <summary>
        ///     总金额
        /// </summary>
        public decimal? N_ZONGJINE
        {
            get { return m_dec_n_zongjine; }
            set { m_dec_n_zongjine = value; }
        }

        /// <summary>
        ///     总笔数
        /// </summary>
        public decimal? I_ZONGBIS
        {
            get { return m_dec_i_zongbis; }
            set { m_dec_i_zongbis = value; }
        }

        /// <summary>
        ///     本行总金额
        /// </summary>
        public decimal? N_BENHANGZJE
        {
            get { return m_dec_n_benhangzje; }
            set { m_dec_n_benhangzje = value; }
        }

        /// <summary>
        ///     本行总笔数
        /// </summary>
        public decimal? I_BENHANGZBS
        {
            get { return m_dec_i_benhangzbs; }
            set { m_dec_i_benhangzbs = value; }
        }

        /// <summary>
        ///     跨行总金额
        /// </summary>
        public decimal? N_KUAHANGZJE
        {
            get { return m_dec_n_kuahangzje; }
            set { m_dec_n_kuahangzje = value; }
        }

        /// <summary>
        ///     跨行总笔数
        /// </summary>
        public decimal? I_KUAHANGZBS
        {
            get { return m_dec_i_kuahangzbs; }
            set { m_dec_i_kuahangzbs = value; }
        }

        /// <summary>
        ///     到帐金额
        /// </summary>
        public decimal? N_DAOZHANGJE
        {
            get { return m_dec_n_daozhangje; }
            set { m_dec_n_daozhangje = value; }
        }

        /// <summary>
        ///     到帐笔数
        /// </summary>
        public decimal? I_DAOZHANGBS
        {
            get { return m_dec_i_daozhangbs; }
            set { m_dec_i_daozhangbs = value; }
        }

        /// <summary>
        ///     本行到帐金额
        /// </summary>
        public decimal? N_HENHANGDZJE
        {
            get { return m_dec_n_henhangdzje; }
            set { m_dec_n_henhangdzje = value; }
        }

        /// <summary>
        ///     本行到帐笔数
        /// </summary>
        public decimal? I_BENHANGDZBS
        {
            get { return m_dec_i_benhangdzbs; }
            set { m_dec_i_benhangdzbs = value; }
        }

        /// <summary>
        ///     跨行到帐金额
        /// </summary>
        public decimal? N_KUAHANGDZJE
        {
            get { return m_dec_n_kuahangdzje; }
            set { m_dec_n_kuahangdzje = value; }
        }

        /// <summary>
        ///     跨行到帐笔数
        /// </summary>
        public decimal? I_KUAHANGDZBS
        {
            get { return m_dec_i_kuahangdzbs; }
            set { m_dec_i_kuahangdzbs = value; }
        }

        /// <summary>
        ///     退票金额
        /// </summary>
        public decimal? N_TUIPIAOJE
        {
            get { return m_dec_n_tuipiaoje; }
            set { m_dec_n_tuipiaoje = value; }
        }

        /// <summary>
        ///     退票笔数
        /// </summary>
        public decimal? I_TUIPIAOBS
        {
            get { return m_dec_i_tuipiaobs; }
            set { m_dec_i_tuipiaobs = value; }
        }

        /// <summary>
        ///     本行退票金额
        /// </summary>
        public decimal? N_BENHANGTPJE
        {
            get { return m_dec_n_benhangtpje; }
            set { m_dec_n_benhangtpje = value; }
        }

        /// <summary>
        ///     本行退票笔数
        /// </summary>
        public decimal? I_BENHANGTPBS
        {
            get { return m_dec_i_benhangtpbs; }
            set { m_dec_i_benhangtpbs = value; }
        }

        /// <summary>
        ///     跨行退票金额
        /// </summary>
        public decimal? N_KUAHANGTPJE
        {
            get { return m_dec_n_kuahangtpje; }
            set { m_dec_n_kuahangtpje = value; }
        }

        /// <summary>
        ///     跨行退票笔数
        /// </summary>
        public decimal? I_KUAHANGTPBS
        {
            get { return m_dec_i_kuahangtpbs; }
            set { m_dec_i_kuahangtpbs = value; }
        }

        /// <summary>
        ///     其它金额
        /// </summary>
        public decimal? N_QITAJE
        {
            get { return m_dec_n_qitaje; }
            set { m_dec_n_qitaje = value; }
        }

        /// <summary>
        ///     其它笔数
        /// </summary>
        public decimal? I_QITABS
        {
            get { return m_dec_i_qitabs; }
            set { m_dec_i_qitabs = value; }
        }

        /// <summary>
        ///     导入日期
        /// </summary>
        public DateTime? D_DAORURQ
        {
            get { return m_DT_d_daorurq; }
            set { m_DT_d_daorurq = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_TYPE
        {
            get { return m_dec_i_type; }
            set { m_dec_i_type = value; }
        }

        /// <summary>
        ///     是否逻辑删除
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_ZW_YINHANGHPHZProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_ZW_YINHANGHPHZProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_ZW_YINHANGHPHZ实体添加或者修改YS_ZW_YINHANGHPHZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_ZW_YINHANGHPHZ YS_ZW_YINHANGHPHZ, OracleTransaction Transaction)
        {
            if (YS_ZW_YINHANGHPHZ.ID == 0)
                InsertYS_ZW_YINHANGHPHZ(YS_ZW_YINHANGHPHZ, Transaction);
            else
                UpdateYS_ZW_YINHANGHPHZ(YS_ZW_YINHANGHPHZ, Transaction);
            return YS_ZW_YINHANGHPHZ.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_ZW_YINHANGHPHZ实体添加或修改YS_ZW_YINHANGHPHZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_ZW_YINHANGHPHZ YS_ZW_YINHANGHPHZ)
        {
            return InsertOrUpdate(YS_ZW_YINHANGHPHZ, null);
        }


        /// <summary>
        ///     根据YS_ZW_YINHANGHPHZ主键删除YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_ZW_YINHANGHPHZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_ZW_YINHANGHPHZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_ZW_YINHANGHPHZ主键删除YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_ZW_YINHANGHPHZ(decimal ID)
        {
            return DeleteYS_ZW_YINHANGHPHZ(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_ZW_YINHANGHPHZsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_ZW_YINHANGHPHZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_ZW_YINHANGHPHZsDynamic(string WhereClause)
        {
            return DeleteYS_ZW_YINHANGHPHZsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_ZW_YINHANGHPHZ主键选择YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_ZW_YINHANGHPHZ信息</returns>
        public YS_ZW_YINHANGHPHZ SelectYS_ZW_YINHANGHPHZ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_ZW_YINHANGHPHZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_ZW_YINHANGHPHZ = PopulateYS_ZW_YINHANGHPHZ(rd);
                rd.Close();
                return YS_ZW_YINHANGHPHZ;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_ZW_YINHANGHPHZ主键选择YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <returns>YS_ZW_YINHANGHPHZ信息</returns>
        public YS_ZW_YINHANGHPHZ SelectYS_ZW_YINHANGHPHZ(decimal ID)
        {
            return SelectYS_ZW_YINHANGHPHZ(ID, null);
        }

        /// <summary>
        ///     选择所有YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_ZW_YINHANGHPHZ信息</returns>
        public DataTable SelectYS_ZW_YINHANGHPHZsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_ZW_YINHANGHPHZsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <returns>所有YS_ZW_YINHANGHPHZ信息</returns>
        public DataTable SelectYS_ZW_YINHANGHPHZsAll()
        {
            return SelectYS_ZW_YINHANGHPHZsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_ZW_YINHANGHPHZ信息</returns>
        public DataTable SelectYS_ZW_YINHANGHPHZsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_ZW_YINHANGHPHZsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_ZW_YINHANGHPHZ信息</returns>
        public DataTable SelectYS_ZW_YINHANGHPHZsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_ZW_YINHANGHPHZsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_ZW_YINHANGHPHZ信息</returns>
        public DataTable SelectYS_ZW_YINHANGHPHZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_ZW_YINHANGHPHZsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_ZW_YINHANGHPHZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_ZW_YINHANGHPHZ信息</returns>
        public DataTable SelectYS_ZW_YINHANGHPHZsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_ZW_YINHANGHPHZsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_ZW_YINHANGHPHZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_ZW_YINHANGHPHZsDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_ZW_YINHANGHPHZDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_ZW_YINHANGHPHZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_ZW_YINHANGHPHZsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_ZW_YINHANGHPHZsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_ZW_YINHANGHPHZ(YS_ZW_YINHANGHPHZ YS_ZW_YINHANGHPHZ, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_ZW_YINHANGHPHZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_ZW_YINHANGHPHZ.I_ZWYM;
            storedParams[1].Value = YS_ZW_YINHANGHPHZ.S_WENJIANM;
            storedParams[2].Value = YS_ZW_YINHANGHPHZ.D_RIQI;
            storedParams[3].Value = YS_ZW_YINHANGHPHZ.N_ZONGJINE;
            storedParams[4].Value = YS_ZW_YINHANGHPHZ.I_ZONGBIS;
            storedParams[5].Value = YS_ZW_YINHANGHPHZ.N_BENHANGZJE;
            storedParams[6].Value = YS_ZW_YINHANGHPHZ.I_BENHANGZBS;
            storedParams[7].Value = YS_ZW_YINHANGHPHZ.N_KUAHANGZJE;
            storedParams[8].Value = YS_ZW_YINHANGHPHZ.I_KUAHANGZBS;
            storedParams[9].Value = YS_ZW_YINHANGHPHZ.N_DAOZHANGJE;
            storedParams[10].Value = YS_ZW_YINHANGHPHZ.I_DAOZHANGBS;
            storedParams[11].Value = YS_ZW_YINHANGHPHZ.N_HENHANGDZJE;
            storedParams[12].Value = YS_ZW_YINHANGHPHZ.I_BENHANGDZBS;
            storedParams[13].Value = YS_ZW_YINHANGHPHZ.N_KUAHANGDZJE;
            storedParams[14].Value = YS_ZW_YINHANGHPHZ.I_KUAHANGDZBS;
            storedParams[15].Value = YS_ZW_YINHANGHPHZ.N_TUIPIAOJE;
            storedParams[16].Value = YS_ZW_YINHANGHPHZ.I_TUIPIAOBS;
            storedParams[17].Value = YS_ZW_YINHANGHPHZ.N_BENHANGTPJE;
            storedParams[18].Value = YS_ZW_YINHANGHPHZ.I_BENHANGTPBS;
            storedParams[19].Value = YS_ZW_YINHANGHPHZ.N_KUAHANGTPJE;
            storedParams[20].Value = YS_ZW_YINHANGHPHZ.I_KUAHANGTPBS;
            storedParams[21].Value = YS_ZW_YINHANGHPHZ.N_QITAJE;
            storedParams[22].Value = YS_ZW_YINHANGHPHZ.I_QITABS;
            storedParams[23].Value = YS_ZW_YINHANGHPHZ.D_DAORURQ;
            storedParams[24].Value = YS_ZW_YINHANGHPHZ.I_TYPE;
            storedParams[25].Value = YS_ZW_YINHANGHPHZ.I_JLZT;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_ZW_YINHANGHPHZ.ID = Convert.ToInt32(storedParams[26].Value);
            return result;
        }

        private bool UpdateYS_ZW_YINHANGHPHZ(YS_ZW_YINHANGHPHZ YS_ZW_YINHANGHPHZ, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_ZW_YINHANGHPHZ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_ZW_YINHANGHPHZ.I_ZWYM;
            storedParams[1].Value = YS_ZW_YINHANGHPHZ.S_WENJIANM;
            storedParams[2].Value = YS_ZW_YINHANGHPHZ.D_RIQI;
            storedParams[3].Value = YS_ZW_YINHANGHPHZ.N_ZONGJINE;
            storedParams[4].Value = YS_ZW_YINHANGHPHZ.I_ZONGBIS;
            storedParams[5].Value = YS_ZW_YINHANGHPHZ.N_BENHANGZJE;
            storedParams[6].Value = YS_ZW_YINHANGHPHZ.I_BENHANGZBS;
            storedParams[7].Value = YS_ZW_YINHANGHPHZ.N_KUAHANGZJE;
            storedParams[8].Value = YS_ZW_YINHANGHPHZ.I_KUAHANGZBS;
            storedParams[9].Value = YS_ZW_YINHANGHPHZ.N_DAOZHANGJE;
            storedParams[10].Value = YS_ZW_YINHANGHPHZ.I_DAOZHANGBS;
            storedParams[11].Value = YS_ZW_YINHANGHPHZ.N_HENHANGDZJE;
            storedParams[12].Value = YS_ZW_YINHANGHPHZ.I_BENHANGDZBS;
            storedParams[13].Value = YS_ZW_YINHANGHPHZ.N_KUAHANGDZJE;
            storedParams[14].Value = YS_ZW_YINHANGHPHZ.I_KUAHANGDZBS;
            storedParams[15].Value = YS_ZW_YINHANGHPHZ.N_TUIPIAOJE;
            storedParams[16].Value = YS_ZW_YINHANGHPHZ.I_TUIPIAOBS;
            storedParams[17].Value = YS_ZW_YINHANGHPHZ.N_BENHANGTPJE;
            storedParams[18].Value = YS_ZW_YINHANGHPHZ.I_BENHANGTPBS;
            storedParams[19].Value = YS_ZW_YINHANGHPHZ.N_KUAHANGTPJE;
            storedParams[20].Value = YS_ZW_YINHANGHPHZ.I_KUAHANGTPBS;
            storedParams[21].Value = YS_ZW_YINHANGHPHZ.N_QITAJE;
            storedParams[22].Value = YS_ZW_YINHANGHPHZ.I_QITABS;
            storedParams[23].Value = YS_ZW_YINHANGHPHZ.D_DAORURQ;
            storedParams[24].Value = YS_ZW_YINHANGHPHZ.I_TYPE;
            storedParams[25].Value = YS_ZW_YINHANGHPHZ.I_JLZT;
            storedParams[26].Value = YS_ZW_YINHANGHPHZ.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_ZW_YINHANGHPHZ PopulateYS_ZW_YINHANGHPHZ(IDataReader dr)
        {
            var YS_ZW_YINHANGHPHZ = new YS_ZW_YINHANGHPHZ();
            YS_ZW_YINHANGHPHZ.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_ZW_YINHANGHPHZ.I_ZWYM = dr["I_ZWYM"] == DBNull.Value ? null : (decimal?) dr["I_ZWYM"];
            YS_ZW_YINHANGHPHZ.S_WENJIANM = dr["S_WENJIANM"] == DBNull.Value ? null : (string) dr["S_WENJIANM"];
            YS_ZW_YINHANGHPHZ.D_RIQI = dr["D_RIQI"] == DBNull.Value ? null : (DateTime?) dr["D_RIQI"];
            YS_ZW_YINHANGHPHZ.N_ZONGJINE = dr["N_ZONGJINE"] == DBNull.Value ? null : (decimal?) dr["N_ZONGJINE"];
            YS_ZW_YINHANGHPHZ.I_ZONGBIS = dr["I_ZONGBIS"] == DBNull.Value ? null : (decimal?) dr["I_ZONGBIS"];
            YS_ZW_YINHANGHPHZ.N_BENHANGZJE = dr["N_BENHANGZJE"] == DBNull.Value ? null : (decimal?) dr["N_BENHANGZJE"];
            YS_ZW_YINHANGHPHZ.I_BENHANGZBS = dr["I_BENHANGZBS"] == DBNull.Value ? null : (decimal?) dr["I_BENHANGZBS"];
            YS_ZW_YINHANGHPHZ.N_KUAHANGZJE = dr["N_KUAHANGZJE"] == DBNull.Value ? null : (decimal?) dr["N_KUAHANGZJE"];
            YS_ZW_YINHANGHPHZ.I_KUAHANGZBS = dr["I_KUAHANGZBS"] == DBNull.Value ? null : (decimal?) dr["I_KUAHANGZBS"];
            YS_ZW_YINHANGHPHZ.N_DAOZHANGJE = dr["N_DAOZHANGJE"] == DBNull.Value ? null : (decimal?) dr["N_DAOZHANGJE"];
            YS_ZW_YINHANGHPHZ.I_DAOZHANGBS = dr["I_DAOZHANGBS"] == DBNull.Value ? null : (decimal?) dr["I_DAOZHANGBS"];
            YS_ZW_YINHANGHPHZ.N_HENHANGDZJE =
                dr["N_HENHANGDZJE"] == DBNull.Value ? null : (decimal?) dr["N_HENHANGDZJE"];
            YS_ZW_YINHANGHPHZ.I_BENHANGDZBS =
                dr["I_BENHANGDZBS"] == DBNull.Value ? null : (decimal?) dr["I_BENHANGDZBS"];
            YS_ZW_YINHANGHPHZ.N_KUAHANGDZJE =
                dr["N_KUAHANGDZJE"] == DBNull.Value ? null : (decimal?) dr["N_KUAHANGDZJE"];
            YS_ZW_YINHANGHPHZ.I_KUAHANGDZBS =
                dr["I_KUAHANGDZBS"] == DBNull.Value ? null : (decimal?) dr["I_KUAHANGDZBS"];
            YS_ZW_YINHANGHPHZ.N_TUIPIAOJE = dr["N_TUIPIAOJE"] == DBNull.Value ? null : (decimal?) dr["N_TUIPIAOJE"];
            YS_ZW_YINHANGHPHZ.I_TUIPIAOBS = dr["I_TUIPIAOBS"] == DBNull.Value ? null : (decimal?) dr["I_TUIPIAOBS"];
            YS_ZW_YINHANGHPHZ.N_BENHANGTPJE =
                dr["N_BENHANGTPJE"] == DBNull.Value ? null : (decimal?) dr["N_BENHANGTPJE"];
            YS_ZW_YINHANGHPHZ.I_BENHANGTPBS =
                dr["I_BENHANGTPBS"] == DBNull.Value ? null : (decimal?) dr["I_BENHANGTPBS"];
            YS_ZW_YINHANGHPHZ.N_KUAHANGTPJE =
                dr["N_KUAHANGTPJE"] == DBNull.Value ? null : (decimal?) dr["N_KUAHANGTPJE"];
            YS_ZW_YINHANGHPHZ.I_KUAHANGTPBS =
                dr["I_KUAHANGTPBS"] == DBNull.Value ? null : (decimal?) dr["I_KUAHANGTPBS"];
            YS_ZW_YINHANGHPHZ.N_QITAJE = dr["N_QITAJE"] == DBNull.Value ? null : (decimal?) dr["N_QITAJE"];
            YS_ZW_YINHANGHPHZ.I_QITABS = dr["I_QITABS"] == DBNull.Value ? null : (decimal?) dr["I_QITABS"];
            YS_ZW_YINHANGHPHZ.D_DAORURQ = dr["D_DAORURQ"] == DBNull.Value ? null : (DateTime?) dr["D_DAORURQ"];
            YS_ZW_YINHANGHPHZ.I_TYPE = dr["I_TYPE"] == DBNull.Value ? null : (decimal?) dr["I_TYPE"];
            YS_ZW_YINHANGHPHZ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            return YS_ZW_YINHANGHPHZ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion